%div.col-lg-12
  %hr
  %h4 Transformation Scratchpad

  /# %p The longest binary string is used as the comparison baseline (B) below
  %br
  / -`inspectrum`


  - @sections.each do |section|
    %h5= section.name
    %table.table.table-hover.table-bordered{style:'background-color:black;'}
      %thead
        %tr
          %th{:style => "color:grey;"} Capture
          %th{:style => "color:grey;"} Binary
          %th{:style => "color:grey;"} Decimal
          %th{:style => "color:grey;"} Flipped Decimal
      %tbody

        - captures.each do |capture|
          %tr
            %th{style:"background-color:#{section.colour};"}
              = capture.unit.name
              %br
              = capture.name
              %br
              = "id: #{capture.id}"
            %td{:style=>"min-width:200px;"}
              - if device.could_be_pwm_7525?
                - b=capture.pwm_decode_7525
              - elsif device.could_be_pwm?
                - b=capture.pwm_decode
              - elsif device.could_be_manchester?
                - b=capture.manchester_decode
              - else
                - b=capture.original_binary
              - section_binary = b[section.start_pos..section.end_pos]
              = section_binary 
            %td
              = section_binary.to_i(2)
            %td
              = section_binary.gsub("1","one").gsub("0","zero").gsub("zero","1").gsub("one",'0').to_i(2)

  %br



